package com.taomu.app.zongchouhuli.http.utls;

/**
 * @author by keZhong
 */

public class ServerErrorException extends Exception {

    private ServiceResponseErrorBean responseError;

    public ServerErrorException(ServiceResponseErrorBean mResponseError) {
        responseError = mResponseError;
    }

    @Override
    public String getMessage() {
        if (responseError != null) {
            return responseError.getMsg();
        }
        return super.getMessage();
    }

    public int getErrorCode() {
        if (responseError == null) {
            return -1;
        }
        return responseError.getCode();
    }

}
